using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using RanchBuddy.Core.Domain.Impl;
using StructureMap;

namespace RanchBuddy.Core.Domain
{
    [PluginFamily("Default")]
    public interface IAccount : IValidate, INotifyPropertyChanging, INotifyPropertyChanged
    {
        bool IsValid { get; }

        [Column(Storage = "_AccountID", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true, UpdateCheck = UpdateCheck.Never)]
        int AccountID { get; set; }

        [Column(Storage = "_Timestamp", AutoSync = AutoSync.Always, DbType = "rowversion NOT NULL", CanBeNull = false, IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
        System.Data.Linq.Binary Timestamp { get; set; }

        [Column(Storage = "_CreateDate", DbType = "SmallDateTime NOT NULL", UpdateCheck = UpdateCheck.Never)]
        System.DateTime CreateDate { get; set; }

        [Column(Storage = "_UpdateDate", DbType = "SmallDateTime NOT NULL", UpdateCheck = UpdateCheck.Never)]
        System.DateTime UpdateDate { get; set; }

        [Column(Storage = "_Username", DbType = "VarChar(20) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string Username { get; set; }

        [Column(Storage = "_Password", DbType = "VarChar(50) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string Password { get; set; }

        [Column(Storage = "_SecretQuestion", DbType = "VarChar(200) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string SecretQuestion { get; set; }

        [Column(Storage = "_SecretAnswer", DbType = "VarChar(200) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string SecretAnswer { get; set; }

        [Column(Storage = "_FirstName", DbType = "VarChar(30) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string FirstName { get; set; }

        [Column(Storage = "_LastName", DbType = "VarChar(30) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string LastName { get; set; }

        [Column(Storage = "_Zipcode", DbType = "VarChar(50) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string Zipcode { get; set; }

        [Column(Storage = "_Email", DbType = "VarChar(150) NOT NULL", CanBeNull = false, UpdateCheck = UpdateCheck.Never)]
        string Email { get; set; }

        [Column(Storage = "_HomePhone", DbType = "VarChar(20)", UpdateCheck = UpdateCheck.Never)]
        string HomePhone { get; set; }

        [Column(Storage = "_CellPhone", DbType = "VarChar(20)", UpdateCheck = UpdateCheck.Never)]
        string CellPhone { get; set; }

        [Column(Storage = "_WorkPhone", DbType = "VarChar(20)", UpdateCheck = UpdateCheck.Never)]
        string WorkPhone { get; set; }

        [Column(Storage = "_EmailVerified", DbType = "Bit", UpdateCheck = UpdateCheck.Never)]
        System.Nullable<bool> EmailVerified { get; set; }

        [Column(Storage = "_TermID", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
        System.Nullable<int> TermID { get; set; }

        [Column(Storage = "_VerificationKey", DbType = "UniqueIdentifier", UpdateCheck = UpdateCheck.Never)]
        System.Nullable<System.Guid> VerificationKey { get; set; }

        [Column(Storage = "_Website", DbType = "VarChar(150)", UpdateCheck = UpdateCheck.Never)]
        string Website { get; set; }

        [Column(Storage = "_Birthdate", DbType = "SmallDateTime", UpdateCheck = UpdateCheck.Never)]
        System.Nullable<System.DateTime> Birthdate { get; set; }

        [Association(Name = "Account_CompanyAccount", Storage = "_CompanyAccounts", ThisKey = "AccountID", OtherKey = "AccountID")]
        EntitySet<CompanyAccount> CompanyAccounts { get; set; }

        IEnumerable<RuleViolation> GetRuleViolations();
        void Validate();
        event PropertyChangingEventHandler PropertyChanging;
        event PropertyChangedEventHandler PropertyChanged;
    }
}